import letter
import reverse
import encode

def get_user_input():
    while True:
        user_input = input("请输入字符串（0到255个字符）：")
        if 0 < len(user_input) <= 255:
            return user_input
        else:
            print("输入的字符串长度不符合要求，请重新输入。")

if __name__ == "__main__":
    user_string = get_user_input()
    cleaned_string = letter.remove_non_english(user_string)
    reversed_string = reverse.reverse_string(cleaned_string)
    encoded_string = encode.caesar_cipher(reversed_string)
    print("加密后的字符串：", encoded_string)
